class Solution:
    def uniquePaths(self, m: int, n: int) -> int:
        return self.up(m, n)

    def up(self, m, n):
        if m > 1 and n > 1:
            return self.up(m - 1, n) + self.up(m, n - 1)
        if m > 1 and n == 1:
            return self.up(m - 1, n)
        if m == 1 and n > 1:
            return self.up(m, n - 1)
        return 1

solu = Solution()
print(solu.uniquePaths(3, 2))